new Vue({
  el: "#app",
  data() {
    return {
      id: 1,
      bgPage: chrome.extension.getBackgroundPage()
    };
  },

  methods: {
    sendContentScrpit(options) {
        chrome.tabs.query({active: true, currentWindow: true}, function(tabs){  
            chrome.tabs.sendMessage(tabs[0].id, options, function(response) {
                typeof response == 'function' ? response() : console.log(response)
            });  
        }); 
    },
    spiderTaobao() {
        this.sendContentScrpit({
            cmd: 'spider_taobao'
        })
        this.bgPage.spiderType = 'spider_taobao'
    }
  }
});
